using Cysharp.Threading.Tasks;

namespace EventBus
{
    /// <summary>
    /// 单个事件发送器
    /// </summary>
    public interface ISender
    {
        /// <summary>
        /// 以同步发送事件给Action类型的回调函数处理
        /// </summary>
        /// <param name="callback">回调函数</param>
        /// <param name="argCount">参数数量（0 ～ 8）</param>
        /// <param name="arg1">参数1</param>
        /// <param name="arg2">参数2</param>
        /// <param name="arg3">参数3</param>
        /// <param name="arg4">参数4</param>
        /// <param name="arg5">参数5</param>
        /// <param name="arg6">参数6</param>
        /// <param name="arg7">参数7</param>
        /// <param name="arg8">参数8</param>
        /// <typeparam name="T1">参数1类型</typeparam>
        /// <typeparam name="T2">参数2类型</typeparam>
        /// <typeparam name="T3">参数3类型</typeparam>
        /// <typeparam name="T4">参数4类型</typeparam>
        /// <typeparam name="T5">参数5类型</typeparam>
        /// <typeparam name="T6">参数6类型</typeparam>
        /// <typeparam name="T7">参数7类型</typeparam>
        /// <typeparam name="T8">参数8类型</typeparam>
        void SendAction<T1, T2, T3, T4, T5, T6, T7, T8>(object callback, int argCount, T1 arg1, T2 arg2,
            T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);

        /// <summary>
        /// 以异步发送事件给Action类型的回调函数处理
        /// </summary>
        /// <param name="callback">回调函数</param>
        /// <param name="argCount">参数数量（0 ～ 8）</param>
        /// <param name="arg1">参数1</param>
        /// <param name="arg2">参数2</param>
        /// <param name="arg3">参数3</param>
        /// <param name="arg4">参数4</param>
        /// <param name="arg5">参数5</param>
        /// <param name="arg6">参数6</param>
        /// <param name="arg7">参数7</param>
        /// <param name="arg8">参数8</param>
        /// <typeparam name="T1">参数1类型</typeparam>
        /// <typeparam name="T2">参数2类型</typeparam>
        /// <typeparam name="T3">参数3类型</typeparam>
        /// <typeparam name="T4">参数4类型</typeparam>
        /// <typeparam name="T5">参数5类型</typeparam>
        /// <typeparam name="T6">参数6类型</typeparam>
        /// <typeparam name="T7">参数7类型</typeparam>
        /// <typeparam name="T8">参数8类型</typeparam>
        UniTask SendActionAsync<T1, T2, T3, T4, T5, T6, T7, T8>(object callback, int argCount, T1 arg1, T2 arg2,
            T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);

        /// <summary>
        /// 以同步发送事件给Function类型的回调函数处理， 返回最后一个回调函数的返回值
        /// </summary>
        /// <param name="callback">回调函数</param>
        /// <param name="argCount">参数数量（0 ～ 8）</param>
        /// <param name="arg1">参数1</param>
        /// <param name="arg2">参数2</param>
        /// <param name="arg3">参数3</param>
        /// <param name="arg4">参数4</param>
        /// <param name="arg5">参数5</param>
        /// <param name="arg6">参数6</param>
        /// <param name="arg7">参数7</param>
        /// <param name="arg8">参数8</param>
        /// <typeparam name="T1">参数1类型</typeparam>
        /// <typeparam name="T2">参数2类型</typeparam>
        /// <typeparam name="T3">参数3类型</typeparam>
        /// <typeparam name="T4">参数4类型</typeparam>
        /// <typeparam name="T5">参数5类型</typeparam>
        /// <typeparam name="T6">参数6类型</typeparam>
        /// <typeparam name="T7">参数7类型</typeparam>
        /// <typeparam name="T8">参数8类型</typeparam>
        /// <typeparam name="TResult">返回值类型</typeparam>
        /// <returns>返回回调函数的返回值</returns>
        TResult SendFunc<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(object callback, int argCount, T1 arg1, T2 arg2,
            T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);

        /// <summary>
        /// 以异步的方式发送事件给Function类型的回调函数处理， 返回回调函数的返回值
        /// </summary>
        /// <param name="callback">回调函数</param>
        /// <param name="argCount">参数数量（0 ～ 8）</param>
        /// <param name="arg1">参数1</param>
        /// <param name="arg2">参数2</param>
        /// <param name="arg3">参数3</param>
        /// <param name="arg4">参数4</param>
        /// <param name="arg5">参数5</param>
        /// <param name="arg6">参数6</param>
        /// <param name="arg7">参数7</param>
        /// <param name="arg8">参数8</param>
        /// <typeparam name="T1">参数1类型</typeparam>
        /// <typeparam name="T2">参数2类型</typeparam>
        /// <typeparam name="T3">参数3类型</typeparam>
        /// <typeparam name="T4">参数4类型</typeparam>
        /// <typeparam name="T5">参数5类型</typeparam>
        /// <typeparam name="T6">参数6类型</typeparam>
        /// <typeparam name="T7">参数7类型</typeparam>
        /// <typeparam name="T8">参数8类型</typeparam>
        /// <typeparam name="TResult">返回值类型</typeparam>
        /// <returns>返回回调函数的返回值</returns>
        UniTask<TResult> SendFuncAsync<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(object callback, int argCount, T1 arg1,
            T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
    }
}